package org.bangumibuddy.mapper;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.bangumibuddy.entity.AnimeSummaryEntity;

@Mapper
public interface AnimeSummaryMapper {

    @Select("select * from AnimeSummary where animeId = #{id}")
    AnimeSummaryEntity getAnimeSummaryByAnimaId(Long id);

    @Insert("insert into AnimeSummary(animeId, poster, description, season, `year`, `month`, type, backgroundColor, backgroundURL) values" +
            "(#{animeId}, #{poster}, #{description}, #{season}, #{year}, #{month}, #{type}, #{backgroundColor}, #{backgroundURL})")
    void addAnimeSummary(AnimeSummaryEntity animeSummaryEntity);
}
